******************************************************************
******************************************************************
*Schito, Marco: The politics of State aid in the European Union: explaining variation in aid allocation among Member States
*Published in: Journal of Public Policy
*Stata do file for replication analysis of Table 2
******************************************************************
******************************************************************

use jpp_state_aid.dta
xtset country1 year

***MAIN MODEL (AR1) - Table 2
**h1
xtpcse logsa  reg1999z  ///
	L_incentives1 L_enop1 L_vprange ///
	L_realecongrowth L_koftr L_koffi fmelecindex emu L_debt L_unemp ///
	i.country1, cor(ar1) pairwise 
estimates store m1h1

**h2a
xtpcse  logsa  reg1999z c.L_incentives1#c.reg1999z ///
	L_incentives1 L_enop1  ///
	c.L_incentives1#c.L_enop1   ///
	L_realecongrowth L_koftr L_koffi fmelecindex emu L_debt L_unemp ///
	i.country1, cor(ar1) pairwise 
estimates store m1h2a


**h2b
xtpcse  logsa  reg1999z c.L_incentives1#c.reg1999z ///
	L_incentives1 L_vprange  ///
	c.L_incentives1#c.L_vprange   ///
	L_realecongrowth L_koftr L_koffi fmelecindex emu L_debt L_unemp ///
	i.country1, cor(ar1) pairwise 
estimates store m1h2b

**h4
xtpcse logsa  ///
	L_realecongrowth L_koftr L_koffi fmelecindex emu L_debt L_unemp ///
	logmdmh persindex c.logmdmh#c.persindex  ///
	i.country1, cor(ar1) pairwise 
estimates store m1h4

**full model
xtpcse logsa  reg1999z c.L_incentives1#c.reg1999z ///
	L_incentives1 L_enop1 L_vprange ///
	c.L_incentives1#c.L_enop1 c.L_incentives1#c.L_vprange  ///
	L_realecongrowth L_koftr L_koffi fmelecindex emu L_debt L_unemp ///
	logmdmh persindex c.logmdmh#c.persindex  ///
	i.country1, cor(ar1) pairwise 
estimates store m1full

estimates table m1h1 m1h2a m1h2b m1h4 m1full, star


outreg2 [m1h1 m1h2a m1h2b m1h4 m1full] using Table_2, ///
title("Table 2: State aid in the EU27 (1992-2011)") ///
addnote("Note: Prais-Winsten regressions with PCSE and pairwise selection. Standard errors in parentheses") ///
stats(coef se blank) addstat(Wald  $\chi^2$, e(chi2), $\rho$, e(p)) ///
bdec(3) sdec(3) pdec(3) ///
seeout label ///
keep(reg1999z L_incentives1 L_enop1 L_vprange c.L_incentives1#c.L_enop1 c.L_incentives1#c.L_vprange c.L_incentives1#c.reg1999z logmdmh persindex c.logmdmh#c.persindex L_realecongrowth L_koftr L_koffi  fmelecindex emu L_debt L_unemp) ///
sortvar(L_incentives1 L_enop1 L_vprange c.L_incentives1#c.L_enop1 c.L_incentives1#c.L_vprange reg1999z c.L_incentives1#c.reg1999z logmdmh persindex c.logmdmh#c.persindex L_realecongrowth L_koftr L_koffi  fmelecindex emu L_debt L_unemp) ///
tex(frag)
